/*
 * vmbdoor.h
 */

#ifndef _VMBDOOR_H_
#define _VMBDOOR_H_

/*
 * General VMware backdoor values
 */
#define VMWARE_MAGIC		0x564D5868		/* Beckdoor magic number		*/
#define VMWARE_PORT			0x5658			/* Backdoor port number			*/

/*
 * Backdoor commands
 */

#define VMCMD_APM_FUNCTION	0x02			/* APM function?				*/

#define VMCMD_GET_CURSOR	0x04			/* Get cursor position			*/
#define VMCMD_SET_CURSOR	0x05			/* Set cursor position			*/
#define VMCMD_GET_CLIPLEN	0x06			/* host->guest copy length		*/
#define VMCMD_GET_CLIPDATA	0x07			/* host->guest copy data		*/
#define VMCMD_SET_CLIPLEN	0x08			/* guest->host copy length		*/
#define VMCMD_SET_CLIPDATA	0x09			/* guest->host copy date		*/
#define VMCMD_GET_VERSION	0x0a			/* Get version number			*/
#define VMCMD_GET_DEVICE	0x0b			/* Get device information 		*/
#define VMCMD_SET_DEVICE	0x0c			/* Set device state				*/
#define VMCMD_GET_SETTING	0x0d			/* Get preference settings		*/
#define VMCMD_SET_SETTING	0x0e			/* Set Preference settings		*/
#define VMCMD_GET_HOSTRES	0x0f			/* Get host's screen size		*/

#define VMCMD_POPUP_DIALOG	0x12			/* OS not fount message popup	*/

#define VMCMD_GET_VMCONFIG	0x14			/* Get VM config information	*/

#define VMCMD_GET_TIME		0x17			/* Get host's time (GMT)		*/

#define VMCMD_TRANSFER		0x1e			/* Generic data transfer		*/

/*
 *	Preference bitmask (for VMCMD_GET_SETTING, VMCMD_SET_SETTING)
 */
#define VMPREF_GRAB_MOVE	0x0001			/* grab by cursor movement		*/
#define VMPREF_UNGRAB_MOVE	0x0002			/* ungrab by cursor movement	*/
#define	VMPREF_SCROLL_MOVE	0x0004			/* scroll by cursor movement	*/
#define VMPREF_COPY_PASTE	0x0010			/* copy and paste 				*/
#define VMPREF_FULLSCREEN	0x0040			/* full screen (read only)		*/
#define VMPREF_ENTER_FULL	0x0080			/* full screen (write only)		*/
#define VMPREF_SYNCRONIZE	0x0400			/* time syncronization			*/

#define VMCLIP_MAX_LENGTH	65355			/* maximum copy & paste length	*/

#if __INTSIZE == 2							/* 16 bit dos environment		*/
typedef unsigned int uint16;
typedef unsigned long uint32;
#else										/* 32 bit environment			*/
typedef unsigned short uint16;
typedef unsigned int uint32;
#endif	/* __INTSIZE */

#ifndef TRUE
#define	TRUE	1
#define FALSE	0
#endif	/* TRUE */

#ifndef NULL
#define NULL	0
#endif	/* NULL	*/

#ifdef __cplusplus
extern "C" {
#endif	/* __cplusplus */

int VMBackDoor(
	uint32 *reg_a,
	uint32 *reg_b,
	uint32 *reg_c,
	uint32 *reg_d);

int VMGetVersion();

#ifdef __cplusplus
}
#endif	/* __cplusplus */

#endif	/* _VMBDOOR_H_ */
/* end of file */
